home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
basic
/
rtx.exe
/
RTXGUIDE.TXT
< prev
next >
Wrap
Text File
|
1992-09-02
|
90KB
|
2,988 lines
R t x P r o f e s s i o n a l T o o l b o x
Report Toolbox for Microsoft PDS
------------------
PROGRAMMER'S GUIDE
------------------
Cyberphilia, Inc.
1465 Midland Avenue
Bronxville, NY 10708-6035
-- Telephones --
7 Days a week, 24 hours a day:
In New York City Metropolitan Area
(800) 300-2018
Elsewhere
(914) 337-8322
TABLE OF CONTENTS
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . i
ABOUT THE AUTHORS . . . . . . . . . . . . . . . . . . . . . . . . ii
SHAREWARE NOTICE . . . . . . . . . . . . . . . . . . . . . . . . iv
COMPILING & LINKING WITH RTX . . . . . . . . . . . . . . . . . . v
TUTORIAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
EXAMPLE USING BINARY DATA FILE . . . . . . . . . . . . . . . 3
EXAMPLE USING ISAM DATA FILE . . . . . . . . . . . . . . . . 11
THE RESULTING OUTPUT . . . . . . . . . . . . . . . . . . . . 14
TOOLBOX REFERENCE . . . . . . . . . . . . . . . . . . . . . . . . 15
RtxClose . . . . . . . . . . . . . . . . . . . . . . . . . . 16
RtxData . . . . . . . . . . . . . . . . . . . . . . . . . . 17
RtxGetBreak . . . . . . . . . . . . . . . . . . . . . . . . 18
RtxGetPage . . . . . . . . . . . . . . . . . . . . . . . . . 19
RtxGetRemaining . . . . . . . . . . . . . . . . . . . . . . 20
RtxInit . . . . . . . . . . . . . . . . . . . . . . . . . . 21
RtxNewPage . . . . . . . . . . . . . . . . . . . . . . . . . 22
RtxOpen . . . . . . . . . . . . . . . . . . . . . . . . . . 23
RtxOutput . . . . . . . . . . . . . . . . . . . . . . . . . 24
RtxResult . . . . . . . . . . . . . . . . . . . . . . . . . 25
RtxSetBreak . . . . . . . . . . . . . . . . . . . . . . . . 26
RtxSetBreak0 . . . . . . . . . . . . . . . . . . . . . . . . 27
RtxSetColumn . . . . . . . . . . . . . . . . . . . . . . . . 28
RtxSetError . . . . . . . . . . . . . . . . . . . . . . . . 30
RtxSetFooting . . . . . . . . . . . . . . . . . . . . . . . 31
RtxSetForm . . . . . . . . . . . . . . . . . . . . . . . . . 32
RtxSetHeading . . . . . . . . . . . . . . . . . . . . . . . 34
RtxSetPrinter . . . . . . . . . . . . . . . . . . . . . . . 35
RtxSkip . . . . . . . . . . . . . . . . . . . . . . . . . . 36
RtxSuppress . . . . . . . . . . . . . . . . . . . . . . . . 37
APPENDIX A - RESULT CODES . . . . . . . . . . . . . . . . . . . . 40
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
INTRODUCTION
Rtx Professional Toolbox is a library for Microsoft PDS v7.x which
enables programmers to add professional-quality reporting
capabilities to their applications with ease.
When Microsoft introduced the User Interface Toolbox, Presentation
Graphics Toolbox and PROISAM into PDS, it instantly became a credible
environment to create top quality business applications. However,
despite all their enhancements to PDS for improved screen
presentation and storage of data, only LPRINT exists to output that
data to a piece of paper. Rtx was written to compliment Microsoft's
enhancements to PDS and complete the picture.
Using a few simple calls to the Rtx library, you can quickly set up a
business report format. Once you have, just pass it the raw data and
it takes care of the rest. Rtx handles page breaks, headers and
footers, formatting and subtotalling columnar data and much more.
Rtx is distributed on bulletin boards or from shareware houses as one
compressed .ZIP file: RTX.ZIP. It contains the Rtx library
(RTX.LIB), this document (RTXGUIDE.TXT), product registration form
(REGISTER.TXT), and two header files which you must include at the
top of any program you create which uses Rtx (RTX.BI, RTXMEM.BI).
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [i]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
ABOUT THE AUTHORS
Cyberphilia, Inc. is a small computer consulting firm based in the
New York City area. Established originally by Carlos-Manuel Abreu as
a one-man show in 1983, now in our 10th year we're still only five
consultants strong.
Cyberphilia is committed to providing affordable, effective contract
programming and consultancy services to businesses in the New York
area. To do so, we remain a small, tight-knit group working from our
homes. We're joined by CyberNet, workgroup software developed in-
house for our own use. With CyberNet we exchange electronic mail,
co-develop software and documentation, and distribute and handle
technical assistance calls.
The release of our Professional Toolbox product line is a departure
for us. Until now, all the toolboxes we've created were for
exclusive use in the software we write for our clients. Recently,
however, we decided to market these toolboxes as shareware. We
supply full source code in Microsoft PDS v7.1 to registered users
along with exhaustive documentation. Source code is supplied with
the understanding that it is for your personal use and can be
modified to suit your needs and recompiled for inclusion in your own
end-user applications. We strictly forbid, however, redistributing
the source code, in whole or in part. Furthermore, the source code
cannot be used to build another library for subsequent sale. Each of
our toolboxes represents long hours of design work and programming;
we've burned a lot of midnight oil. We trust you'll understand our
desire to protect a lot hard work. Besides, it wouldn't be a very
nice thing to do. You wouldn't like it if we did it to you, eh?
Rtx is our first toolbox to be released as shareware. We're sprucing
up the others now and are wrapping up the documentation. In a minute
we'll fill you in on other exciting toolboxes that are on their way
from Cyberphilia, Inc. during 1992.
We sincerely hope that you'll find our toolboxes useful and opt to
register. We're anxious to hear from you, so drop us a line. Caveat
Emptor: We're a little wacky. (In this business, who isn't?)
Carlos-Manuel Abreu ("Chuck")
Joseph DiMuro ("Joe")
John Owens ("Jack")
Elisa Medina ("Lisa")
Peter McGahan ("Pete")
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [ii]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
OTHER SHAREWARE PRODUCTS FROM CYBERPHILIA
Mtx Professional Toolbox Available September, 1992
Add memo fields to your data files and ISAM databases. Allows
you to associate free-form, variable-length text fields to your
fixed-length data records. Why say COMMENTS AS STRING*30 when
you can say COMMENTS AS MEMO?
Xtx Professional Toolbox Available September, 1992
Our Xtx toolbox allows you to import from and export to a wide
variety of commonly used file formats. Read and write Lotus 1-
2-3 files, DBASE (XBASE) files, mail-merge files and more all
under your direct program control.
Btx Professional Toolbox Available October, 1992
Our business toolbox provides you with core accounting modules
which allow you to quickly assemble complete interactive
business applications. Modules include General Ledger, Accounts
Receivable, Accounts Payable, Payroll, Job Costing and Financial
Reporting.
Dtx Professional Toolbox Available November, 1992
Add a sophisticated text retrieval engine to your PDS
applications. Allows you to create document databases
programmatically from source documents in ASCII and a variety of
popular word processor formats. Instantly locate all
occurrences of a word or phrase. Dtx supports most common text
retrieval operations, including: stemming (automatic conflation
of words to root words), truncation (manual conflation using
wildcard characters), weighting (indexing based on statistical
distribution of terms), stoplists (eliminate words that have no
indexing value) and thesaurus (conflation using synonymous
terms).
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [iii]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
SHAREWARE NOTICE
Rtx Professional Toolbox is Shareware, not freeware. After a thirty
day evaluation period, if you continue to use Rtx Professional
Toolbox, you are required to register the product and include a
license fee of $30.00 by check or money order. The license fee will
entitle you to a copy of the Rtx Professional Toolbox source code
(subject to terms), written entirely in Microsoft PDS v7.1, and
telephone support for 90 days after the date of purchase.
To register, print out the registration form, REGISTER.TXT included
with RTX.ZIP. Fill in your name, company name (if applicable),
address, city, state, zip code and telephone number at the top. In
order to receive Rtx source code, you must read and sign the non-
disclosure statement found at the bottom of the registration form.
Mail the completed form along with your check or money order for
$30.00 to:
Cyberphilia, Inc.
1465 Midland Avenue
Bronxville, NY 10708-6035
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [iv]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
COMPILING & LINKING WITH RTX
To use Rtx in your applications, you must include the RTX.BI file,
distributed with the toolbox, at the top of your source code among
the declarations. It contains the subprogram and function
declarations necessary to call Rtx procedures. Additionally, you
must include the RTXMEM.BI file at the top of your source code among
your memory allocation statements. It dimensions commonly shared
global arrays that Rtx uses to store active report information.
Please do not make any modifications to these header files. It may
seem at first that you can change the MaxColumns constant, for
example, to accommodate more columns on your reports, however doing
so will corrupt the aforementioned shared memory block because
MaxColumns is already "etched in stone" in RTX.LIB. If you register
with us you'll receive the complete Rtx source code. With the source
code on hand, you can modify these files as needed because you can
always recompile the Rtx with the new parameters.
When linking your programs to produce final executables, you'll have
to include RTX.LIB, QBX.LIB and DTFMTER.LIB. RTX.LIB contains the
actual Rtx procedures. QBX.LIB is needed because Rtx uses the Call
Interrupt procedure. Finally, DTFMTER.LIB is required because Rtx
uses the procedures contained therein to format data to be printed on
reports.
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [v]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
TUTORIAL
The easiest way to learn how to use Rtx is by example. The upcoming
pages present a simple application and a detailed line-by-line
explanation. Please refer to the TOOLBOX REFERENCE section elsewhere
in this document for more detailed information on all available Rtx
entry points.
Assume you're writing accounting software and need to give it the
capability to produce a cash disbursements journal from its accounts
payable module. Each transaction record would minimally contain a
Transaction Date, Payee's ID Number, Check Number, Account Number and
an Amount. For the purposes of this example we'll use the following
record structure for the data ...
Type TransactionStruc ' Transaction record structure
Date As String*6 ' 6-digit date as YYMMDD
Payee As String*4 ' 4-digit payee or vendor ID
Check As String*4 ' 4-digit check number
Account As String*5 ' 5-digit account number
Amount As Currency ' Amount as currency
End Type
... and say that the data file contains the following data ...
REC# -DATE- PAYEE CHECK ACCOUNT -AMOUNT-
1 911001 1234 1001 20450 100.00
2 911001 1235 1002 20451 150.00
3 911001 1401 1003 20452 125.00
4 911001 1401 1004 20450 110.00
5 911001 1402 1005 20451 205.00
6 911002 1260 1007 20450 190.00
7 911002 1261 1008 20451 175.00
8 911002 1261 1009 20452 160.00
9 911002 1261 1010 20450 155.00
... and say that we'd like the report to print the information,
totalling transactions by date and subtotalling them by payee within
each date.
The key to understanding Rtx can be found in the dynamics of the data
with which it is supplied. Notice how the data in the Date column
changes from record 5 (911001) to 6 (911002). This is known to Rtx
as a "break," that is, a break in the flow of the column's data. A
break also occurs several times in the Payee column and in every case
of the Amount column. Even though Rtx recognizes breaks in all
columns, only the first two are of any interest to us in this example
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [1]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
because we want Rtx to stop and print totals when a break in these
columns occurs.
Initially Rtx recognizes no special handling for columnar breaks.
Calls to the RtxSetBreak procedure dictate action to be taken (e.g.
inserting subtotals, skipping lines, or jumping to the top of a new
page) when a break in specific columns occur. The upcoming code
samples, though simplistic, clearly demonstrate how we might use Rtx
to generate our sample report. The line numbers at the left are for
documentation purposes only here, and are not part of the code
itself. A detailed explanation appears after the program listing.
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [2]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
EXAMPLE USING BINARY DATA FILE
Data must be supplied to Rtx in the order in which it is to print on
the final report for it to correctly determine breaks. In this
example, the data stored in the file is already sorted by date and
then by payee within each date.
[01] | '$Include: 'Rtx.Bi'
| '
[02] | Const TRNRecSiz = 27
| '
[03] | '$Include: 'RtxMem.Bi'
| '
[04] | Type TransactionStruc
| Date As String*6
| Payee As String*4
| Check As String*4
| Account As String*5
| Amount As Currency
| End Type
| '
[05] | Dim _
| TRN As TransactionStruc, _
| I As Integer, _
| Recs As Integer
| '
[06] | DataFile = FreeFile
[07] | Open "TEST.DAT" For Binary As DataFile
| '
[08] | RtxInit
| '
[09] | RtxSetPrinter 1
[10] | RtxSetError 25
[11] | RtxSetForm 80, 66, 0, 3, 3
| '
[12] | RtxSetHeading 1, "CASH DISBURSEMENTS JOURNAL", 2
| RtxSetHeading 2, "=", 0
| RtxSetHeading 3, "", 0
| '
[13] | RtxSetFooting 1, "", 0
| RtxSetFooting 2, "=", 0
| RtxSetFooting 3, "Date: " + Date$ + " Page: ^P", 1
| '
[14] | RtxSetColumn 1, "Date", 1, "########", 0, False, True
| RtxSetColumn 2, "Payee", 1, "#####", 1, False, True
| RtxSetColumn 3, "Check", 1, "#####", 1, False, False
| RtxSetColumn 4, "Account", 1, "#######", 1, False, False
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [3]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
| RtxSetColumn 5, "Amount", 6, "#####0.00", 1, True, False
| '
[15] | RtxSetBreak 1, 1, 2, "DATE TOTALS"
| RtxSetBreak 2, 2, 1, "PAYEE TOTALS"
| '
[16] | RtxSetBreak0 "REPORT TOTALS"
|
[17] | RtxOpen "TEST.TXT", True
[18] | If RtxResult = RTXSUCCESS Then
[19] | Recs = Lof(DataFile) \ TRNRecSiz
[20] | For I = 1 To Recs
[21] | Get #DataFile,, TRN
[22] | RtxData 1, Mid$(TRN.Date, 3, 2) + "/" + _
| Right$(TRN.Date, 2) + "/" + Left$(TRN.Date, 2)
[23] | RtxData 2, TRN.Payee
[24] | RtxData 3, TRN.Check
[25] | RtxData 4, TRN.Account
[26] | RtxData 5, Mkc$(TRN.Amount)
[27] | RtxOutput
[28] | Next I
[29] | RtxClose 3, True
[30] | End If
| '
[31] | Close DataFile
[32] | End
DETAILED EXPLANATION
[01] '$Include: 'Rtx.Bi'
The Rtx header file must be included at the top of any
application you write that uses Rtx. It includes Rtx-specific
constants, procedure, function and global memory declarations.
[02] TRNRecSiz = 27
Declares the size, in bytes, of the transaction records in the
data file.
[03] '$Include: 'RtxMem.Bi'
Allocates global arrays.
This statement must appear exactly as it appears immediately
following your declarations (non-executing statements). Do not
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [4]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
change any constants (such as MaxHeaders) in the Rtx.Bi file as
unpredictable errors will occur. Changing them in your
application will not change the constants used by the library
which are "etched in stone."
[04] Type TransactionStruc
Date As String*6
Payee As String*4
Check As String*4
Account As String*5
Amount As Currency
End Type
Declares the structure of data records in the file.
[05] Dim _
TRN As TransactionStruc, _
I As Integer, _
Recs As Integer
Allocates a buffer to contain data retrieved from the file, and
declares both an integer local loop counter and integer variable
to hold the number of records in the data file.
[06] DataFile = FreeFile
Obtains a free file handle.
[07] Open "TEST.DAT" For Binary As DataFile
Opens the data file for binary access on the acquired free file
handle.
[08] RtxInit
Initializes the Rtx system. RtxInit must be called before using
the Rtx system.
[09] RtxSetPrinter 1
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [5]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
Informs Rtx that LPT1 is to be used for printing hardcopies of
report images. LPT1 through LPT3 are supported.
[10] RtxSetError 25
Informs Rtx that when printing hardcopies, screen line 25 should
be used to display informational messages and prompts to the
user when errors occur during printing, such as paper jams or
when the printer is out of paper. This is known as "interactive
error handling." If this had been set to 0 and an error occurs
during printing, Rtx would simply cancel printing and return a
result code to the application indicating the nature of the
error, in effect disabling interactive error handling.
[11] RtxSetForm 80, 66, 0, 3, 3
Characteristics of the output form are defined here. In this
case the statement reads "80 characters across, 66 lines down,
no left margin, top margin is 3 lines and bottom margin is 3
lines."
[12] RtxSetHeading 1, "CASH DISBURSEMENTS JOURNAL", 2
RtxSetHeading 2, "=", 0
RtxSetHeading 3, "", 0
Defines report header lines. The statements read "The first
line of the heading is to be 'CASH DISBURSEMENTS JOURNAL' and
should be centered. Fill the second report heading line with
equal signs to achieve a horizontal double line. The final line
is blank."
[13] RtxSetFooting 1, "", 0
RtxSetFooting 2, "=", 0
RtxSetFooting 3, "Date: " + Date$ + " Page: ^P", 1
Similar to RtxSetHeading, RtxSetFooting declares footer lines in
a top-down fashion. This statement defines a blank line as the
first footing line, the second a horizontal double line, and the
final the current date and page number, flush right.
[14] RtxSetColumn 1, "Date", 1, "########", 0, False, True
RtxSetColumn 2, "Payee", 1, "#####", 1, False, True
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [6]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxSetColumn 3, "Check", 1, "#####", 1, False, False
RtxSetColumn 4, "Account", 1, "#######", 1, False, False
RtxSetColumn 5, "Amount", 6, "#####0.00", 1, True, False
Defines report columns. It is not necessary that columns be
defined in order, but they must contiguous (i.e. once all
columns have been defined, there cannot be any gaps between the
numbers.) Columns are numbered from left to right, with a
maximum of 10 columns supported by Rtx.
The statement for the first column reads "Set the column heading
to 'Date', the date will be supplied as a string (1), mask the
data as 8 characters in length ('########'), print flush left
(0), do not maintain or print totals for this column (False),
and form a hanging indent (True) by printing only the first
occurrence of the column data when two or more consecutive rows
have the same contents in this column."
Rtx, when printing column headings, underlines them with hyphens
to the length of the mask. If the heading text is longer than
the mask it is truncated to the length of the mask.
The statement for the second column sets the column heading to
'Payee', specifies that the Payee ID will be supplied as a
string (1), the data will be masked to 5 characters in length
('#####'), printing will be flush right (1), it is not a
totalling column (False) and should form a hanging indent
(True).
The statement for the third column sets the column heading to
'Check', specifies that the Check Number will be supplied as a
string (1), the data will be masked to 5 characters in length
('#####'), printing will be flush right (1), it is not a
totalling column (False) and should always print (False, no
hanging indent).
The statement for the fourth column sets the column heading to
'Account', specifies that the Account Number will be supplied as
a string (1), the data will be masked to 7 characters in length
('#######'), printing will be flush right (1), it is not a
totalling column (False) and should always print (False, no
hanging indent).
The statement for the final column sets the column heading to
'Amount', specifies that the Amount will be supplied as Currency
in string format using Mkc$() (6), the data will be masked to 9
characters in length, scaled to two digits after the decimal
point ('#####0.00'), printing will be flush right (1), totals of
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [7]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
this column are to be maintained and printed at breaks set by
RtxSetBreak (True) and should always print (False, no hanging
indent).
[15] RtxSetBreak 1, 1, -1, "DATE TOTALS"
RtxSetBreak 2, 2, 1, "PAYEE TOTALS"
Sets breaks in the report. The statements read "Set the first
break (1) to trigger when there is a break in the first column
(1, Date), skip to the top of the next page after printing
totals (-1, page break) and precede the totals with the text
'DATE TOTALS'. Set the second break (2) to trigger when there
is a break in the second column (2, Payee), skip one blank row
after printing totals (1) and precede the totals with the text
'PAYEE TOTALS'."
[16] RtxSetBreak0 "REPORT TOTALS"
Sets special break '0', that is, the final break that occurs
when a report is closed. This statement reads "Precede report
totals that print at the end of the report with the text 'REPORT
TOTALS.'"
[17] RtxOpen "TEST.TXT", True
Opens the file to receive the report image ('TEST.TXT') and
tells Rtx to overwrite any file with the same name (True) by
deleting it first.
[18] If RtxResult = RTXSUCCESS Then
Tests to see if the most recent Rtx call (RtxOpen) was
successful.
[19] Recs = Lof(DataFile) \ TRNRecSiz
Determines the number of transaction records in the data file by
performing an integer divide of the record size constant into
the length of the data file.
[20] For I = 1 To Recs
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [8]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
Loops through all records in the data file.
[21] Get #DataFile,, TRN
Reads the current record into the TRN record buffer.
[22] RtxData 1, Mid$(TRN.Date, 3, 2) + "/" + _
Right$(TRN.Date, 2) + "/" + Left$(TRN.Date, 2)
Sends data to be placed in column 1 to Rtx. The statement reads
"The data for column one of the current row (1) is the YYMMDD
date string (TRN.Date) formatted to MM/DD/YY.
[23] RtxData 2, TRN.Payee
Sends the Payee ID string of the current record to be placed in
column 2.
[24] RtxData 3, TRN.Check
Sends the Check Number string of the current record to be placed
in column 3.
[25] RtxData 4, TRN.Account
Sends the Account Number string of the current record to be
placed in column 4.
[26] RtxData 5, Mkc$(TRN.Amount)
Sends the Amount of the current record, which is in native
Currency type, as a string by first converting it with Mkc$().
[27] RtxOutput
Outputs the current row, formed by prior calls to RtxData, to
the report image file, first checking for and processing any
breaks that occur between the previous row at the pending one.
[28] Next I
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [9]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
Continues to next iteration of read loop.
[29] RtxClose 3, True
Indicates that report is complete. The statement reads
"Terminate processing the report, print three copies (3) and
retain the report image file for possible use later (True).
[30] End If
End of IF/END IF block on successful RtxOpen.
[31] Close DataFile
[32] End
Closes the data file and ends the program.
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [10]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
EXAMPLE USING ISAM DATA FILE
Unlike the example using a binary data file which requires that data
is sorted first, data can be extracted from an ISAM file in the
necessary order, regardless of how it was entered originally, by
using an index that is comprised of the concatenated transaction Date
and Payee ID. Alpha markers [A..Z] on the left highlight where the
program differs from the binary file example
| '$Include: 'Rtx.Bi'
| '$Include: 'RtxMem.Bi'
| '
| Type TransactionStruc
| Date As String*6
| Payee As String*4
| Check As String*4
| Account As String*5
| Amount As Currency
| End Type
| '
| Dim _
| TRN As TransactionStruc, _
| I As Integer, _
| Recs As Integer
| '
[A] | Open "TEST.MDB" For ISAM TransactionStruc "CASH" As DataFile
[B] | CreateIndex DataFile, "DatePayee", False, "Date", "Payee"
[C] | SetIndex DataFile, "DatePayee"
| '
| RtxInit
| '
| RtxSetPrinter 1
| RtxSetError 25
| RtxSetForm 80, 66, 0, 3, 3
| '
| RtxSetHeading 1, "CASH DISBURSEMENTS JOURNAL", 2
| RtxSetHeading 2, "=", 0
| RtxSetHeading 3, "", 0
| '
| RtxSetFooting 1, "", 0
| RtxSetFooting 2, "=", 0
| RtxSetFooting 3, "Date: " + Date$ + " Page: ^P", 1
| '
| RtxSetColumn 1, "Date", 1, "########", 0, False, True
| RtxSetColumn 2, "Payee", 1, "#####", 1, False, True
| RtxSetColumn 3, "Check", 1, "#####", 1, False, False
| RtxSetColumn 4, "Account", 1, "#######", 1, False, False
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [11]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
| RtxSetColumn 5, "Amount", 6, "#####0.00", 1, True, False
| '
| RtxSetBreak 1, 1, 2, "DATE TOTALS"
| RtxSetBreak 2, 2, 1, "PAYEE TOTALS"
| '
| RtxSetBreak0 "REPORT TOTALS"
|
| RtxOpen "TEST.TXT", True
| If RtxResult = RTXSUCCESS Then
[D] | MoveFirst DataFile
| Do While Not Eof(DataFile)
[E] | Retrieve DataFile, TRN
| RtxData 1, Mid$(TRN.Date, 3, 2) + "/" + _
| Right$(TRN.Date, 2) + "/" + Left$(TRN.Date, 2)
| RtxData 2, TRN.Payee
| RtxData 3, TRN.Check
| RtxData 4, TRN.Account
| RtxData 5, Mkc$(TRN.Amount)
| RtxOutput
[F] | MoveNext DataFile
| Loop
| RtxClose 3, True
| End If
| '
[G] | DeleteIndex DataFile, "DatePayee"
|
| Close DataFile
| End
DETAILED EXPLANATION
Only new or changed lines which apply to ISAM handling are detailed
here. Please read the previous section "EXAMPLE USING BINARY DATA
FILE" first.
[A] Open "TEST.MDB" For ISAM TransactionStruc "CASH" As DataFile
Opens the ISAM data file, indicating that records are of type
'TransactionStruc' and the table within the file containing the
cash disbursement transactions is called 'CASH'.
[B] CreateIndex DataFile, "DatePayee", False, "Date", "Payee"
Creates a sorted index for the table comprised of the Date and
Payee ID. In doing so, records can be retrieved sequentially in
Date and Payee order.
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [12]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
[C] SetIndex DataFile, "DatePayee"
Makes the index just created the current one.
[D] MoveFirst DataFile
Moves the record pointer to the first record in the table, by
index order.
[E] Retrieve DataFile, TRN
Retrieves the current record into the TRN record buffer.
[F] MoveNext DataFile
Moves the record pointer to the next record in the table, by
index order.
[G] DeleteIndex DataFile, "DatePayee"
Deletes the 'DatePayee' created earlier in the program.
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [13]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
THE RESULTING OUTPUT
CASH DISBURSEMENTS JOURNAL
=================================================================
Date Payee Check Account Amount
-------- ----- ----- ------- ---------
10/01/91 1234 1001 20450 100.00
1235 1002 20451 150.00
1401 1003 20452 125.00
1004 20450 110.00
---------
PAYEE TOTALS 235.00
1402 1005 20451 205.00
---------
DATE TOTALS 690.00
10/02/91 1260 1007 20450 190.00
1261 1008 20451 175.00
1009 20452 160.00
1010 20450 155.00
---------
PAYEE TOTALS 490.00
---------
DATE TOTALS 680.00
---------
REPORT TOTALS 1370.00
=================================================================
Date: 08-31-1992 Page: 1
And there you have it. Read on for details on all Rtx entry points
available to you.
Enjoy!
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [14]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
TOOLBOX REFERENCE
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [15]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxClose [Subprogram]
Syntax: RtxClose Copies%, Retain%
Terminates processing of the current report, optionally
printing report to printer defined with RtxSetPrinter.
Parameter Type/Description
------------- -----------------------------------------
Copies Integer; Number of copies to print
0 ..... Do not print
>0 .... Print specified number of copies
Retain Integer; Boolean TRUE (-1) or FALSE (0);
Indicates whether report image file should
be retained after printing.
Notes: RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while performing
operation
RTXBADCOPIES% Invalid number of copies (< 0)
RTXNOTOPEN% Report image has not yet been opened
RTXOUTOFPAPER% Printer is out of paper.
RTXNOTONLINE% Printer is not online.
RTXIOERROR% Printer I/O error occurred.
RTXTIMEOUT% Printer timed out.
When printing, recoverable errors can be handled by
interactive screen displays allowing operator to resume
printing when condition is rectified (Paper jam, printer
out of paper, etc.) under Rtx's control.
If Rtx is not handling print errors, an RtxResult of 3-6
indicates the condition and that printing was canceled
automatically. If it is, RtxResult 3-6 is only returned if
the conditions occurred and the operator then opted to
discontinue printing.
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [16]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxData [Subprogram]
Syntax: RtxData Column%, Contents$
Inserts contents of specified column into the current
report row.
Parameter Type/Description
------------- -----------------------------------------
Column Integer in range 1 to the number of columns
defined with RtxSetColumn; Indicates the
report column in which to insert the
associated contents.
Contents String; Contents to insert into specified
column; String format varies depending on
column type as follows:
STRING (Type 1) ... String
INTEGER (Type 2) .. Mki$(Value%)
LONG (Type 3) ..... Mkl$(Value&)
SINGLE (Type 4) ... Mks$(Value!)
DOUBLE (Type 5) ... Mkd$(Value#)
CURRENCY (Type 6) . Mkc$(Value@)
Notes: RtxData requires that Contents be supplied as a string in
order to provide one, consistent interface for all data
types.
RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while
performing operation
RTXBADCOLUMN% Column is out of range (1 to number of
columns defined with RtxSetColumn)
RTXBADCONTENTS% Contents are invalid (i.e. Type 3
column, LONG value, was not passed as a
4-byte Mkl$() string.)
RTXNOTOPEN% Report image file has not yet been
opened
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [17]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxGetBreak [Function]
Syntax: x = RtxGetBreak
Returns the break number, if any, that has either just
occurred or is about to occur.
Notes: RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while performing
operation
RTXNOTOPEN% Report image file has not yet been opened
RtxGetBreak() called immediately prior to RtxOutput returns
the break that will occur once RtxOutput is called. If no
break is about to occur, RtxGetBreak() returns 0.
RtxGetBreak() called immediately after an RtxOutput returns
the break number that has just occurred. RtxGetBreak()
returns 0 if no break has occurred.
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [18]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
==
RtxGetPage [Function]
Syntax: x = RtxGetPage
Returns the current page number.
Notes: RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while performing
operation
RTXNOTOPEN% Report image file has not yet been opened
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [19]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxGetRemaining [Function]
Syntax: x = RtxGetRemaining
Returns the number of printable lines remaining on the
current page.
Notes: RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while performing
operation
RTXNOTOPEN% Report image file has not yet been opened
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [20]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxInit [Subprogram]
Syntax: RtxInit
Initializes Rtx system to begin processing a new report.
Notes: Always returns an RtxResult of RTXSUCCESS%
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [21]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxNewPage [Subprogram]
Syntax: RtxNewPage
Forces printing to continue at the top of a new page.
Notes: RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while performing
operation
RTXNOTOPEN% Report image file has not yet been opened
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [22]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxOpen [Subprogram]
Syntax: RtxOpen FileSpec$, Overwrite%
Opens the report image file for processing.
Parameter Type/Description
------------- -----------------------------------------
FileSpec String; Fully-qualified MS-DOS file name,
including path (if necessary), of the file
to receive the report image.
Overwrite Integer; Boolean TRUE (-1) or FALSE (0); If
TRUE and FileSpec already exists on disk,
Rtx deletes the old copy before opening the
new file.
Notes: RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while
performing operation
RTXBADFILENAME% FileSpec is not a valid MS-DOS file
name.
RTXFILEEXISTS% FileSpec exists but Overwrite is FALSE.
RTXALREADYOPEN% Report image file has already been
opened
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [23]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxOutput [Subprogram]
Syntax: RtxOutput
Outputs current report row to report image file.
Notes: RtxOutput must be called each time a row has been filled by
calls to RtxData and is ready to write to the image file.
RtxOutput then clears out buffers for the next row.
RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while performing
operation
RTXNOTOPEN% Report image has not yet been opened
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [24]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxResult [Function]
Syntax: x = RtxResult
Returns the procedure specific result of the last Rtx call.
Notes: See Appendix A for a list of all known result codes.
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [25]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxSetBreak [Subprogram]
Syntax: RtxSetBreak Number%, Column%, Skip%, Text$
Establishes a "break" in the report, that is, when a
logical break in the report occurs.
Parameter Type/Description
------------- -----------------------------------------
Number Integer in the range 1 to 5, specifying
which break is being declared.
Column Integer in range 1 to number of columns
defined with RtxSetColumn; Column in which
to look for a break.
Skip Integer; the number of blank rows to skip
after processing the break but before
printing the next row. Can also be set to
(-1) to jump to the beginning of a new page.
Text String; Text to print immediately to the
left of the first totalling column.
Notes: Rtx allows up to 5 explicit breaks within each report.
RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while
performing operation
RTXBADBREAK% Number is out of range (1 to 5)
RTXBADCOLUMN% Column is out of range (1 to number of
columns declared with RtxSetColumn)
RTXBADSKIP% Invalid number of rows to skip after
processing break (< -1)
RTXALREADYOPEN% Report image file has already been
opened
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [26]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxSetBreak0 [Subprogram]
Syntax: RtxSetBreak0 Text$
Establishes text to print immediately to the left of the
first totalling column at the end of a report.
Parameter Type/Description
------------- -----------------------------------------
Text String; Text to print immediately to the
left of the first totalling column.
Notes: Break '0' is always processed by Rtx when RtxClose is
called just prior to actually closing the report image
file. It is a special break that exists to flush out final
report totals.
RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while
performing operation
RTXALREADYOPEN% Report image file has already been
opened
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [27]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxSetColumn [Subprogram]
Syntax: RtxSetColumn Column%, Label$, Source%, Mask$, Style%, _
Total%, First%
Declares the characteristics of a report column.
Parameter Type/Description
------------- -----------------------------------------
Column Integer in range 1 to 10; Column being
declared.
Label String; Text to be used as column heading.
Source Integer; Type of source data to be passed by
subsequent RtxData calls as follows:
1 ... STRING
2 ... INTEGER
3 ... LONG
4 ... SINGLE
5 ... DOUBLE
6 ... CURRENCY
Mask String; Mask used to describe length of the
column and format of resulting output.
Style Integer; Specifies justification of
formatted data within the column as follows:
0 ....... Flush left
1 ....... Flush right
2 ....... Centered
Total Integer; Boolean TRUE (-1) or FALSE(0);
Indicates that a total for this column is to
be printed when breaks specified with
RtxSetBreak occur.
First Integer; Boolean TRUE (-1) or FALSE(0);
Indicates that only the first occurrence of
the column's contents are to be printed when
two or more rows contain exactly the same
contents, producing a hanging indent.
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [28]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
Notes: Rtx makes calls to PDS's Format Add-on library using your
mask. You must link your programs with the DTFMTER.LIB
library supplied with your copy of PDS for Rtx to function
properly. Please see PDS's documentation for more
information on specifying masks.
Source types are declared as constants in RTX.BI for your
convenience as follows:
RTXSTRING%, RTXINTEGER%, RTXLONG%, RTXSINGLE%, RTXDOUBLE%,
RTXCURRENCY%
Style types are also declared in RTX.BI for your
convenience:
RTXLEFT%, RTXRIGHT%, RTXCENTER%
RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while
performing operation
RTXBADCOLUMN% Invalid column (< 1 or > 10)
RTXBADSOURCE% Invalid source type (< 1 or > 6)
RTXBADMASK% Invalid or no mask specified
RTXBADSTYLE% Invalid style (< 0 or > 2)
RTXBADTOTAL% Columns with string data cannot be
totalled.
RTXALREADYOPEN% Report image file has already been
opened
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [29]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxSetError [Subprogram]
Syntax: RtxSetError Row%
Parameter Type/Description
------------- -----------------------------------------
Row Integer; Screen row to use when displaying
interactive printer error messages and
prompts or 0 to disable interactive error
handling.
Notes: RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while
performing operation
RTXBADROW% Invalid row (< 0 or > current screen
length)
RTXALREADYOPEN% Report image file has already been
opened
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [30]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxSetFooting [Subprogram]
Syntax: RtxSetFooting Number%, Text$, Style%
Declares a row of footer text.
Parameter Type/Description
------------- -----------------------------------------
Number Integer in range 1 to 5; Report footer row
being declared as 1 to 5, from top to bottom
of footer area.
Text String; Text to be printed in specified row.
Style Integer; Specifies justification of the
footer text within the row as follows:
0 ....... Flush left
1 ....... Flush right
2 ....... Centered
Notes: RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while
performing operation
RTXBADFOOTER% Invalid footer number (< 1 or > 5)
RTXBADSTYLE% Invalid style (< 0 or > 2)
RTXALREADYOPEN% Report image file has already been
opened
Specifying Text as either a single hyphen (-) or a single
equal sign (=) causes Rtx to fill the row across with a
line composed of the respective character.
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [31]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxSetForm [Subprogram]
Syntax: RtxSetForm FormWidth%, FormLength%, LeftMargin%, _
TopMargin%, BottomMargin%
Defines overall form characteristics.
Parameter Type/Description
------------- -----------------------------------------
FormWidth Integer in range 1 to 255; Total number of
printable characters across the page.
FormLength Integer in range 1 to 255; Total number of
printable lines down the page.
LeftMargin Integer in range 0 to width of form; Number
of characters to skip on the left before
printing data.
TopMargin Integer in range 0 to length of form; Number
of lines to skip before printing report
header.
BottomMargin Integer in range 0 to length of form; Number
of lines to skip after printing report
footer before new page.
Notes: RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while
performing operation
RTXBADWIDTH% Invalid form width (< 1 or > 255)
RTXBADLENGTH% Invalid form length (< 1 or > 255)
RTXBADLEFT% Invalid left margin (< 0 or >
FormWidth)
RTXBADTOP% Invalid top margin (0 or > FormLength)
RTXBADBOTTOM% Invalid bottom margin (< 0 or >
FormLength)
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [32]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RTXALREADYOPEN% Report image file has already been
opened
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [33]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxSetHeading [Subprogram]
Syntax: RtxSetHeading Number%, Text$, Style%
Declares a row of heading text.
Parameter Type/Description
------------- -----------------------------------------
Number Integer in range 1 to 5; Report header row
being declared as 1 to 5, from top to bottom
of header area.
Text String; Text to be printed in specified row.
Style Integer; Specifies justification of the
header text within the row as follows:
0 ....... Flush left
1 ....... Flush right
2 ....... Centered
Notes: RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while
performing operation
RTXBADHEADER% Invalid header number (< 1 or > 5)
RTXBADSTYLE% Invalid style (< 0 or > 2)
RTXALREADYOPEN% Report image file has already been
opened
Specifying Text as either a single hyphen (-) or a single
equal sign (=) causes Rtx to fill the row across with a
line composed of the respective character.
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [34]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxSetPrinter [Subprogram]
Syntax: RtxSetPrinter Number%
Specifies the printer to be used when printing reports.
Parameter Type/Description
------------- -----------------------------------------
Number Integer in range 1 to 3 (i.e. LPT1 to LPT3).
Notes: RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while
performing operation
RTXBADPRINTER% Invalid printer number (< 1 or > 3)
RTXALREADYOPEN% Report image file has already been
opened
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [35]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxSkip [Subprogram]
Syntax: RtxSkip Rows%
Skip specified number of rows (output blank rows) in the
report image or skip to the top of a new page.
Parameter Type/Description
------------- -----------------------------------------
Rows Integer; in range -1 to form length
Notes: RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while performing
operation
RTXBADSKIP% Invalid number of rows (< -1 or >
FormLength)
RTXNOTOPEN% Report image has not yet been opened
RtxSkip skips the specified number of lines or until the
bottom of the page is reached, whichever occurs first.
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [36]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
RtxSuppress [Subprogram]
Syntax: RtxSuppress State%
Turns suppression of single-item block subtotals on/off.
Parameter Type/Description
------------- -----------------------------------------
State Integer; Boolean TRUE (-1) or FALSE(0); Sets
new state of single-item block subtotal
suppression.
Notes: RtxResult returns one of the following values:
RTXSUCCESS% Operation completed successfully
RTXUNKNOWN% An unknown error occurred while
performing operation
RTXALREADYOPEN% Report image file has already been
opened
Single-item blocks occur when one break immediately follows
another, resulting in only one item appearing on the
printed page between subtotals. Rtx's normal behavior is
to subtotal at every declared break. Turning suppression
on causes Rtx not to subtotal single-item blocks
unnecessarily, for example:
========================================================
RtxSuppress 10/01/91 1234 1001 20450 100.00
False -------
DATE TOTALS 100.00
--------------------------------------------------------
RtxSuppress 10/01/91 1234 1001 20450 100.00
True
========================================================
The most commonly found single-item block is when only one
line appears in a block as in the above example. However,
they also occur between nested breaks and do not
necessarily consist of only one line, for example:
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [37]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
========================================================
RtxSuppress 10/01/91 1234 1001 20450 100.00
False ---------
PAYEE TOTALS 100.00
1235 1002 20451 150.00
---------
PAYEE TOTALS 150.00
1401 1003 20452 125.00
1004 20450 110.00
---------
PAYEE TOTALS 235.00
1402 1005 20451 205.00
---------
PAYEE TOTALS 205.00
---------
DATE TOTALS 690.00
---------
REPORT TOTALS 690.00
--------------------------------------------------------
RtxSuppress 10/01/91 1234 1001 20450 100.00
True
1235 1002 20451 150.00
1401 1003 20452 125.00
1004 20450 110.00
---------
PAYEE TOTALS 235.00
1402 1005 20451 205.00
---------
REPORT TOTALS 690.00
========================================================
Notice how when RtxSuppress is True, no date totals appear,
but when it's False they do. Even though the block
consists of multiple lines, they're all of the same date
and it's the only date in the report. The date subtotal
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [38]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
and the report total are the same. Turning RtxSuppress ON
(True) eliminates the unnecessary subtotalling of the date.
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [39]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
APPENDIX A - RESULT CODES
The following list details all result codes known to Rtx.
Immediately following each result code is a list of the conditions
that occur which would return such a result code. Please be aware
that the result codes within square brackets are defined as constants
in RTX.BI. Please use these constants instead of the value you find
for them in RTX.BI, as they may change from one version to the next.
[RTXALREADYOPEN%] Report image file has already been opened
RtxOpen has been called and either:
1) This is the first report generated in the session and
RtxInit has not been called.
2) Previously generated report was not terminated with
RtxClose.
3) Operation can only be performed prior to opening the report
image file.
[RTXBADBOTTOM%] Invalid bottom margin
Bottom margin specified is out of range 0 to the length of form
set with RtxSetForm.
[RTXBADBREAK%] Break number specified is out of valid range
1) Break number supplied to RtxSetBreak is out of range 1..5.
2) Break number supplied elsewhere is out of range 0 to number
of breaks set with RtxSetBreak.
[RTXBADCOLUMN%] Invalid column number
1) Column number supplied to RtxSetColumn is out of range
1..10.
2) Column number supplied elsewhere is out of range 1 to
number of columns declared with RtxSetColumn.
[RTXBADCONTENTS%] Contents are invalid
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [40]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
Contents supplied to RtxData for the column are not in the
format expected by Rtx, dictated by the column's source data
type set with RtxSetColumn.
[RTXBADCOPIES%] Invalid number of copies
Number of copies to print specified to RtxClose are out of range
0..255.
[RTXBADFILENAME%] FileSpec is not a valid MS-DOS file name
File name supplied to RtxOpen is not a valid MS-DOS file name,
contains an invalid path or is null.
[RTXBADFOOTER%] Invalid footer number
Footer number supplied to RtxSetFooting is out of range 1..5.
[RTXBADHEADER%] Invalid header number
Header number supplied to RtxSetHeading is out of range 1..5.
[RTXBADLEFT%] Invalid left margin
Left margin value supplied to RtxSetForm is out of range 0 to
form width set with the same call.
[RTXBADLENGTH%] Invalid form length
Form length value supplied to RtxSetForm is out of range 1..255.
[RTXBADMASK%] Invalid or no mask specified
Mask string supplied to RtxSetColumn is either invalid or null.
[RTXBADPRINTER%] Invalid printer number
Printer number supplied to RtxSetPrinter is out of range 1..3.
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [41]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
[RTXBADROW%] Invalid row
Row number supplied to RtxSetError is out of range 0 to the
number of rows currently available on the screen.
[RTXBADSKIP%] Invalid number of rows to skip
1) Rows specified to RtxSkip is out of range -1 to length of
form set with RtxSetForm.
2) Rows specified to RtxSetBreak is out of range -1 to length
of form set with RtxSetForm.
[RTXBADSOURCE%] Invalid source type
Source type specified is out of range 1..6.
[RTXBADSTYLE%] Invalid style
Print style number specified is out of range 0..2.
[RTXBADTOP%] Invalid top margin
Top margin value supplied to RtxSetForm is out of range 0 to
length of form specified in the same call.
[RTXBADTOTAL%] Columns with string data cannot be totalled
The source data type of the column being defined with
RtxSetColumn is STRING and cannot be totalled.
[RTXBADWIDTH%] Invalid form width (< 1 or > 255)
Form width value supplied to RtxSetForm is out of range 1..255.
[RTXFILEEXISTS%] FileSpec exists but Overwrite is FALSE.
RtxOpen was called specifying that a report image file residing
on disk with the same name should not overwritten and the file
exists.
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [42]
[Rtx] Report Toolbox for PDS v7.x PROGRAMMER'S GUIDE
=====================================================================
[RTXIOERROR%] Printer I/O error occurred
A printer i/o error occurred on the printer specified with
RtxSetPrinter while attempting to print a report with RtxClose.
[RTXNOTONLINE%] Printer is not online
The printer specified with RtxSetPrinter is not online or went
offline in the midst of printing.
[RTXNOTOPEN%] Report image has not yet been opened
Requested operation can only be performed once the report image
file has been opened with RtxOpen.
[RTXOUTOFPAPER%] Printer is out of paper
The printer specified with RtxSetPrinter is out of paper or ran
out of paper in the midst of printing.
[RTXSUCCESS%] Operation completed successfully
The Rtx operation completed successfully without incident.
[RTXTIMEOUT%] Printer timed out
The printer specified with RtxSetPrinter has timed out while
attempting to print a report.
[RTXUNKNOWN%] An unknown error occurred while performing operation
An unspecified error, that is, one not handled by Rtx's error
trapping routine has occurred.
=====================================================================
Copyright 1992 by Cyberphilia, Inc. Page [42]
---------------------end of author's documentation-------------------
This program is distributed by Public (software) Library.
For a free copy of our monthly shareware review magazine with a listing
of more than 7000 programs, call or write:
Public (software) Library
P.O.Box 35705
Houston, TX 77235-5705
800-2424-PsL
713-524-6394
FAX: 713-524-6398
CIS: 71355,470